<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>宠物医院</title>
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/css/dashboard.css}" rel="stylesheet">
    <link th:href="@{/img/pet2.jpg}" rel="shortcut icon">
</head>
<body>
<!--顶部导航栏-->
<div th:replace="~{comment/comment::topbar}"></div>
<div class="container-fluid">
    <div class="row">
        <!--侧边导航栏-->
        <div th:replace="~{comment/comment::sidebar(active='pet/petInfo.html')}"></div>
        <!--主视图-->
        <main role="main" class="col-md-9 ml-sm-auto col-lg-11 pt-3 px-4">
            <h2>宠物信息列表</h2>
            <div class="row">
                <div class="col-md-8 column">
                    <a class="btn btn-primary" th:href="@{/addPetPage}">挂号</a>
                    <a class="btn btn-primary" th:href="@{/getPets}">所有宠物信息</a>
                </div>
                <div class="col-md-4 column">
                    <form class="form-inline" th:action="@{/queryPerByName}" method="post">
                        <p style="color: fuchsia" th:text="${msg}" th:if="${not #strings.isEmpty(msg)}"></p>
                        <input type="text" name="name" class="form-control" placeholder="请您输入宠物姓名">
                        <input type="submit" value="查询" class="btn btn-primary">
                    </form>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table table-striped table-sm">
                    <!--表头-->
                    <thead align="center">
                    <tr>
                        <th>单号</th>
                        <th>名字</th>
                        <th>年龄</th>
                        <th>性别</th>
                        <th>病例</th>
                        <th>主人</th>
                        <th>所属科室</th>
                        <th>主治医生</th>
                        <th>操作</th>
                    </tr>
                    </thead >
                    <!--表身-->
                    <tbody align="center">
                    <tr th:each="p:${pets}">
                        <td th:text="${p.getpId()}"></td>
                        <td th:text="${p.getpName()}"></td>
                        <td th:text="${p.getpAge()}">/td>
                        <td th:text="${p.getpSex()==0?'母':'公'}"></td>
                        <td th:text="${p.getIllness()}"></td>
                        <td th:text="${p.getMaster()}"></td>
                        <td th:text="${p.getpSickroom()}"></td>
                        <td th:text="${p.getpDoctor()}"></td>
                        <td>
                            <a class="btn btn-sm btn-primary" th:href="@{/updatePetPage/}+${p.getpId()}">修改信息</a>
                            <a class="btn btn-sm btn-danger" th:href="@{/deletePet/}+${p.getpId()}">删除信息</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </main>
    </div>
</div>
</body>

</html>